package com.wpml.cloud.myprovider.controller;

import com.wpml.cloud.myprovider.service.LogTestService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    private static final Logger LOGGER = LogManager.getLogger(TestController.class);

    @Autowired
    LogTestService logTestService;

    @GetMapping("test")
    public String test() {

        LOGGER.info(">>>>>> TestController >>>>> info......");
        LOGGER.warn(">>>>>> TestController >>>>> warn......");
        LOGGER.error(">>>>>> TestController >>>>> error......");

        logTestService.testLog();

        return "ok";
    }


    public static void main(String[] args) {

        // nacos 密码设置
//        System.out.println(new BCryptPasswordEncoder().encode("wpml"));


        //$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu
    }
}
